<ui:composition xmlns="http://www.w3.org/1999/xhtml"
		        xmlns:h="http://java.sun.com/jsf/html"
		        xmlns:f="http://java.sun.com/jsf/core"
		        xmlns:ui="http://java.sun.com/jsf/facelets"
		        xmlns:fn="http://java.sun.com/jsp/jstl/functions"
		        xmlns:c="http://java.sun.com/jstl/core">
	<h:form>
		<div style="text-align:right;margin-bottom:8px;">
			<div style="float:left;">
				<h:commandButton immediate="true" action="#{demRatesCrud.createSetup}" value="#{msg.lblAddNew}" id="button1" />

				<!-- Paging -->	
				<ui:include src="/snippets/paging.xhtml">
				     <ui:param name="currentCrud" value="#{demRatesCrud}"/>
				</ui:include>			
			</div>
		</div>
		
		<!-- Search Widget -->	
		<ui:include src="/search/searchBox.xhtml">
		     <ui:param name="crud" value="#{demRatesCrud}"/>
		</ui:include>	
		
		<div>
		    <h:outputText escape="false" value="#{msg.demRatesEmpty}" rendered="#{fn:length(demRatesCrud.pagedItems) == 0}" />
		    
		    <h:panelGroup rendered="#{fn:length(demRatesCrud.pagedItems) > 0}">
		        <h:dataTable value="#{demRatesCrud.pagedItems}" var="item" 
		        	columnClasses="center,center,center,center,width3" width="100%" cellspacing="0" cellpadding="0"  >
		            <h:column>
		                <f:facet name="header">
		                    <h:outputText value="#{msg.demRatesStartDate}"/>
		                </f:facet>
		                <h:outputText value="#{item.startDate}" converter="#{calendarConverter}"/>
		            </h:column>
		            <h:column>
		                <f:facet name="header">
		                    <h:outputText value="#{msg.demRatesEndDate}"/>
		                </f:facet>
		                <h:outputText value="#{item.endDate}" converter="#{calendarConverter}" />
		            </h:column>
		            <h:column>
		                <f:facet name="header">
		                    <h:outputText value="#{msg.demRatesEventType}"/>
		                </f:facet>
		                <h:outputText value="#{item.event}" />
		            </h:column>
		            <h:column>
		                <f:facet name="header">
		                    <h:outputText value="#{msg.demRatesDenominator}"/>
		                </f:facet>
		                <h:outputText value="#{item.denominator}" />
		            </h:column>
		            <h:column>
		            	<f:facet name="header">
                        	<h:outputText escape="false" value=""/>
                       	</f:facet>  
                        <h:commandLink id="veiwDetail" action="#{demRatesCrud.detailSetup}">
                            <f:param name="itemId" value="#{item.uuid}"/>
                            <h:graphicImage style="border: 0;" title="details" value="../resources/icons/details.ico" />
                        </h:commandLink>
                        <h:commandLink id="edit" action="#{demRatesCrud.editSetup}" >
                          	<f:param name="itemId" value="#{item.uuid}"/>
                          	<h:graphicImage style="border: 0;" title="edit" value="../resources/icons/edit.ico" />
                        </h:commandLink>
                        <h:commandLink id="deleteLink" action="#{demRatesCrud.delete}">
                            <f:param name="itemId" value="#{item.uuid}"/>
                            <h:graphicImage style="border: 0;" title="delete"  value="../resources/icons/delete.ico"/>
                        </h:commandLink>
                        <h:commandLink id="viewLink" action="#{demRatesCrud.redirectToReports}" target="_blank">
                            <f:param name="itemId" value="#{item.uuid}"/>
                            <h:graphicImage style="border: 0;" title="view report" value="../resources/icons/report.ico"/>
                        </h:commandLink>
		            </h:column>
		        </h:dataTable>
		    </h:panelGroup>
		</div>
	</h:form>
</ui:composition>